package mx.itesm.timeburrito;

import time.burrito.menus.R;
import android.content.Context;
import android.media.MediaPlayer;

public class Musica {
	MediaPlayer player;
	
	public void reproducirAudio(Context context){
		if(player!=null){
    		player.release();
	   	}
	   	player=MediaPlayer.create(context, R.raw.sonido);
	   	player.start();
	}
	 
	 public void detenerAudio(){
		 if(player!=null){
	    		if(player.isPlaying()){
	    			player.stop();
	    			player.release();
	    		}
	    	}
	 }
	 
	 public void pausa(){
		 player.pause();
	 }
	 
	 public void resumir(){
		 player.start();
	 }
}
